<?php

$userid = get_loggedin_userid();
$interest_id = get_input('interest_id');

$ratings = get_interest_ratings_history($interest_id, $userid);

$return = array();
foreach($ratings as $rating) {
    $return[] = to_rating_array($rating);
}

echo json_encode(export_result(200, $return));

?>